package priv.util;

import java.io.Serializable;
import java.util.Map;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

@Configuration
@ImportResource("classpath:util/app.cfg.xml")

@PropertySource("classpath:util/db.properties")
@ComponentScan
public class CollectionDemo {

	public static void main(String[] args) {
		ApplicationContext context = new AnnotationConfigApplicationContext(CollectionDemo.class);
		
		Man man = context.getBean(Man.class);
		System.out.println(man);
		
		Map map = (Map) context.getBean("dsz");
		System.out.println(map);
		
		System.out.println(context.getBean("dataBase"));
		
		Serializable serializable = context.getBean(Serializable.class);
		System.out.println(serializable);
	}

}
